-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Favorites section header from NTP #3381
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dus7
force-pushed
the
mariusz/ntp-remove-favorites-header
branch
2 times, most recently
from
September 23, 2024 13:40
35b9e73
to
e5f9c63
Compare
dus7
force-pushed
the
mariusz/ntp-remove-favorites-header
branch
from
September 23, 2024 14:01
6404f16
to
390354c
Compare
dus7
commented
Sep 24, 2024
Comment on lines
+95
to
+109
func prefixedFavorites(for columnsCount: Int) -> FavoritesSlice { | ||
let hasFavorites = allFavorites.contains(where: \.isFavorite) | ||
let maxCollapsedItemsCount = hasFavorites ? columnsCount * 2 : columnsCount | ||
let isCollapsible = allFavorites.count > maxCollapsedItemsCount | ||
|
||
var favorites = isCollapsed ? Array(allFavorites.prefix(maxCollapsedItemsCount)) : allFavorites | ||
|
||
if !hasFavorites { | ||
for _ in favorites.count ..< maxCollapsedItemsCount { | ||
favorites.append(.placeholder(UUID().uuidString)) | ||
} | ||
} | ||
|
||
return .init(items: favorites, isCollapsible: isCollapsible) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Real changes are here. (62a3c66)
brindy
approved these changes
Sep 24, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
samsymons
added a commit
that referenced
this pull request
Sep 28, 2024
# By Daniel Bernal (12) and others # Via Daniel Bernal (5) and others * main: (46 commits) Release 7.139.0-4 (#3411) Onboarding highlights experiment updates (#3406) fix suggestions performance (#3405) For third party requests differentiate if they are affiliated with first party (#3386) Bump BSK to pull in C-S-S 6.19.0 (#3396) Release 7.139.0-3 (#3399) Onboarding Highlights Ship Review (#3380) add assertions for tabs in suggestions (#3394) Release 7.139.0-2 (#3398) Bump BSK to Include C.S.S 6.17 (#3397) Bump BSK which includes C.S.S 6.17 (#3395) Rever BSK branch Revert "Bump C.S.S" Bump C.S.S translations for Switch to Tab (#3391) Remove Favorites section header from NTP (#3381) Release 7.139.0-1 (#3389) Add origin to /apps URL (#3378) chery pick returning user fix Release 7.138.1-0 (#3388) ... # Conflicts: # DuckDuckGo/AppDependencyProvider.swift
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Task/Issue URL: https://app.asana.com/0/0/1208244619690577/f
Tech Design URL:
CC:
Description:
Removes Favorites header when no favorites present. This allowed to removed whole EmptyStateView. Leftover function was incorporated into
FavoritesViewModel
, allowing to remove the generic type fromNewTabPageView
.Steps to test this PR:
Definition of Done (Internal Only):
Orientation Testing:
Internal references:
Software Engineering Expectations
Technical Design Template